import './assets/styles/index.scss'
import 'amfe-flexible'
import 'virtual:uno.css'
import 'virtual:svg-icons-register'
import 'vant/es/toast/style'
import 'vant/es/notify/style'
import 'vant/es/dialog/style'
import 'vant/lib/index.css'
import 'default-passive-events'
import Vconsole from 'vconsole'

import { createApp } from 'vue'
import { pinia } from "./store"
import { ConfigProvider, setToastDefaultOptions } from 'vant'

import App from './App.vue'
import router from './router'
import i18n from "./locales"

// 设置 Toast 默认层级
setToastDefaultOptions({
  zIndex: 9999,
})

// 创建 Vue 应用实例
const app = createApp(App)

// 使用插件
app.use(ConfigProvider)
app.use(pinia)
app.use(router)
app.use(i18n)

// 挂载应用
app.mount('#app')

// 开启 vConsole（开发环境）
if (import.meta.env.VITE_ENABLE_VCONSOLE === 'true') {
  new Vconsole()
}
